vrx518_tc: fix rx_len_adj
authorMarkus Petri <[email protected]>
Thu, 4 Dec 2025 20:28:51 +0000 (21:28 +0100)
committerHauke Mehrtens <[email protected]>
Wed, 17 Dec 2025 21:03:53 +0000 (22:03 +0100)
Fix rx_len_adj to avoid leaking the ethernet FCS into the actual frame
data in single line mode (the default)

Fixes: https://github.com/openwrt/openwrt/issues/20983
Signed-off-by: Markus Petri <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/21045
Signed-off-by: Hauke Mehrtens <[email protected]>
package/kernel/lantiq/vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch [new file with mode: 0644]

diff --git a/package/kernel/lantiq/vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch b/package/kernel/lantiq/vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch
new file mode 100644 (file)
index 0000000..855da16
--- /dev/null
@@ -0,0 +1,14 @@
+Fixes leaking the ethernet FCS into the frame payload on the RX
+path.
+
+--- a/dcdp/ptm_tc.c
++++ b/dcdp/ptm_tc.c
+@@ -923,7 +923,7 @@ static void ptm_fw_init(struct ptm_ep_pr
+       rx_gitf_cfg.rx_inserted_bytes_1h = 0;
+       rx_gitf_cfg.rx_inserted_bytes_2l = 0;
+       rx_gitf_cfg.rx_inserted_bytes_2h = 0;
+-      rx_gitf_cfg.rx_len_adj          = -2;
++      rx_gitf_cfg.rx_len_adj          = is_bonding ? -2 : -6;
+       for (i = 0; i < 4; i++) {
+               dst_addr = __RX_GIF0_CFG_STATS_CFG +
+                       (i * DW_SZ(rx_gitf_cfg));